import React from 'react';

// 动态导入组件的映射
const ComponentMap: { [key: string]: React.ComponentType<any> } = {
    // 设备管理
    'Device/DeviceInfo': React.lazy(() => import('../screens/Device/DeviceInfo')),//设备信息
    'Device/DeviceInfo/DeviceDetail': React.lazy(() => import('../screens/Device/DeviceInfo/DeviceDetail')),
    'Device/DeviceSpot': React.lazy(() => import('../screens/Device/DeviceSpot')),//点检任务
    'Device/DeviceSpot/DeviceSpotDetail': React.lazy(() => import('../screens/Device/DeviceSpot/DeviceSpotDetail')),//点检任务详情
    'Device/DeviceRepairReport': React.lazy(() => import('../screens/Device/DeviceRepairReport')),//设备报修
    'Device/DeviceRepair': React.lazy(() => import('../screens/Device/DeviceRepair')),//维修任务
    'Device/DeviceRepair/DeviceRepairDetail': React.lazy(() => import('../screens/Device/DeviceRepair/DeviceRepairDetail')),//维修任务详情
    'Device/DeviceRepairReport/DeviceRepairReportDetail': React.lazy(() => import('../screens/Device/DeviceRepairReport/DeviceRepairReportDetail')),//设备报修详情
    'Device/DeviceMaintain': React.lazy(() => import('../screens/Device/DeviceMaintain')),//保养任务
    'Device/DeviceMaintain/DeviceMaintainDetail': React.lazy(() => import('../screens/Device/DeviceMaintain/DeviceMaintainDetail')),//保养任务详情
    'Device/DeviceInspect': React.lazy(() => import('../screens/Device/DeviceInspect')),//巡检任务

    // 质检管理
    'Quality/Ipqc': React.lazy(() => import('../screens/Quality/Ipqc')),//扫码过程检
    'Quality/Ipqc/IpqcDetail': React.lazy(() => import('../screens/Quality/Ipqc/IpqcDetail')),//扫码过程检详情
    'Quality/Iqc': React.lazy(() => import('../screens/Quality/Iqc')),//扫码来料检
    'Quality/Iqc/IqcDetail': React.lazy(() => import('../screens/Quality/Iqc/IqcDetail')),//扫码来料检详情
    'Quality/Oqc': React.lazy(() => import('../screens/Quality/Oqc')),//扫码出库检
    'Quality/Oqc/OqcDetail': React.lazy(() => import('../screens/Quality/Oqc/OqcDetail')),//扫码出库检详情
    'Quality/Fqc': React.lazy(() => import('../screens/Quality/Fqc')),//扫码成品检
    'Quality/Fqc/FqcDetail': React.lazy(() => import('../screens/Quality/Fqc/FqcDetail')),//扫码成品检详情
    'Quality/TotalIpqc': React.lazy(() => import('../screens/Quality/TotalIpqc')),//总数过程检
    'Quality/TotalIpqc/TotalIpqcDetail': React.lazy(() => import('../screens/Quality/TotalIpqc/TotalIpqcDetail')),//总数过程检详情
    'Quality/TotalIqc': React.lazy(() => import('../screens/Quality/TotalIqc')),//总数来料检
    'Quality/TotalIqc/TotalIqcDetail': React.lazy(() => import('../screens/Quality/TotalIqc/TotalIqcDetail')),//总数来料检详情
    'Quality/TotalOqc': React.lazy(() => import('../screens/Quality/TotalOqc')),//总数出库检
    'Quality/TotalOqc/TotalOqcDetail': React.lazy(() => import('../screens/Quality/TotalOqc/TotalOqcDetail')),//总数出库检详情
    'Quality/TotalFqc': React.lazy(() => import('../screens/Quality/TotalFqc')),//总数成品检
    'Quality/TotalFqc/TotalFqcDetail': React.lazy(() => import('../screens/Quality/TotalFqc/TotalFqcDetail')),//总数成品检详情

    // 仓库管理 
    'Warehouse/AsnBody': React.lazy(() => import('../screens/Warehouse/AsnBody')),//待到货
    'Warehouse/AsnUninstall': React.lazy(() => import('../screens/Warehouse/AsnUninstall')),//确认到货
    'Warehouse/AsnPick': React.lazy(() => import('../screens/Warehouse/AsnPick')),//普通分拣
    'Warehouse/AsnPickTray': React.lazy(() => import('../screens/Warehouse/AsnPickTray')),//分拣入盘
    'Warehouse/AsnInStore': React.lazy(() => import('../screens/Warehouse/AsnInStore')),//直接入库
    'Warehouse/AsnTrayInStore': React.lazy(() => import('../screens/Warehouse/AsnTrayInStore')),//托盘入库
    'Warehouse/ProductInStore': React.lazy(() => import('../screens/Warehouse/ProductInStore')),//成品入库
    'Warehouse/AsnDiff': React.lazy(() => import('../screens/Warehouse/AsnDiff')),//到货差异
    'Warehouse/SrnHeader': React.lazy(() => import('../screens/Warehouse/SrnHeader')),//待出货
    'Warehouse/SrnPick': React.lazy(() => import('../screens/Warehouse/SrnPick')),//待拣货
    'Warehouse/SrnDeliver': React.lazy(() => import('../screens/Warehouse/SrnDeliver')),//待运输
    'Warehouse/SrnBody': React.lazy(() => import('../screens/Warehouse/SrnBody')),//出货
    'Warehouse/SrnSign': React.lazy(() => import('../screens/Warehouse/SrnSign')),//签收
    'Warehouse/Inventory': React.lazy(() => import('../screens/Warehouse/Inventory')),//库存
    'Warehouse/Move': React.lazy(() => import('../screens/Warehouse/Move')),//移库
    'Warehouse/SnPickTray': React.lazy(() => import('../screens/Warehouse/SnPickTray')),//序列号分拣入盘
    'Warehouse/SnInStore': React.lazy(() => import('../screens/Warehouse/SnInStore')),//序列号入库

    // 报工
    'ReportWork/ReportWork': React.lazy(() => import('../screens/ReportWork/ReportWork')),//报工
    'ReportWork/Picking': React.lazy(() => import('../screens/ReportWork/Picking')),//领料
    'ReportWork/LeadTooling': React.lazy(() => import('../screens/ReportWork/LeadTooling')),//领用工装
    'ReportWork/UseKnife': React.lazy(() => import('../screens/ReportWork/UseKnife')),//领用刀具
    'ReportWork/MessageCenter': React.lazy(() => import('../screens/ReportWork/MessageCenter')),//消息中心
    'ReportWork/Work2': React.lazy(() => import('../screens/ReportWork/Work2')),//报工2
};

export const getComponentByRoute = (route: string) => {
    return ComponentMap[route];
}; 